<%@page import="com.nxu.biz.impl.BooksBizImpl"%>
<%@page import="com.nxu.biz.BooksBiz"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<%
// 检查是否是管理员
Boolean isAdmin = (Boolean) session.getAttribute("admin");
if (isAdmin == null || !isAdmin) {
    response.sendRedirect("login.jsp");
    return;
}

String isbn = request.getParameter("isbn");
if (isbn != null && !isbn.isEmpty()) {
    BooksBiz biz = new BooksBizImpl();
    boolean success = biz.deleteBook(isbn);
    
    if (success) {
        response.sendRedirect("manage.jsp?msg=delete_success");
    } else {
        response.sendRedirect("manage.jsp?msg=delete_failed");
    }
} else {
    response.sendRedirect("manage.jsp?msg=invalid_isbn");
}
%>